﻿@using GdHotel.Web.Models
@model UiModel

<div class="contact_block">							
	<div class="contact">
		@if (!String.IsNullOrEmpty(Model.Note.FirstPhone)) { <p class="tel corbel">@Html.Raw(Model.Note.FirstPhone)</p> }
		@if (!String.IsNullOrEmpty(Model.Note.SecondPhone)) { <p class="tel corbel">@Html.Raw(Model.Note.SecondPhone)</p> }
		@if (!String.IsNullOrEmpty(Model.Note.ThirdPhone)) { <p class="tel corbel">@Html.Raw(Model.Note.ThirdPhone)</p> }
		<p class="adress corbel">@Html.Raw(Model.Note.AddressShort)<br />@Html.Raw(Model.Note.Email)</p>
	</div>
	<ul class="langs">
        @{
            var classes = new[] {"ru", "en", "chin", "kor"};
            var langs = new[] { "ru", "en", "cn", "kr" };
            var langNames = new[] { "русский", "english", "中國", "한국의" };
            var corbNeeded = new[] { true, true, false, false };
        }

        @for (int i = 0; i < langs.Length; i++)
        {
            var liClass = classes[i];
            var lang = langs[i];
            var language = Model.Language;
            var langName = langNames[i];

            var url = Url.Action("Index", "Home", new {lang});
            var class1 = (corbNeeded[i] ? "corb" : "");
            var class2 = lang.Equals(language.ShortName, StringComparison.InvariantCultureIgnoreCase) ? "active" : "";
            
            <li class="@liClass"><a href="@url" class="@class1 @class2">@langName</a></li>
        }

	</ul>
</div>
